﻿Imports System.Runtime.CompilerServices
Imports System.ServiceModel.Syndication
Imports System.ServiceModel.Web
Imports System.Xml




'adds custom namespaces to an item or a feed
Public Module SyndicationNamespaceHelper

    

    <Extension()> _
    Public Sub DeclareNamespace(ByVal feed As SyndicationFeed, ByVal prefix As String, ByVal ns As String)
        Dim key As New xmlQualifiedname(prefix, NamespaceUris.XMLNamespace)
        feed.AttributeExtensions.Add(key, ns)

    End Sub


    <Extension()> _
    Public Sub DeclareNamespace(ByVal item As SyndicationItem, ByVal prefix As String, ByVal ns As String)
        Dim key As New XmlQualifiedName(prefix, NamespaceUris.XMLNamespace)
        item.AttributeExtensions.Add(key, ns)
    End Sub


End Module
